/**
 * Copyright 2016 the Rex-Soft Group.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.rex.db.exception;

import java.util.Properties;

/**
 * Exception Resource.
 * 
 * @version 1.0, 2016-01-27
 * @since Rexdb-1.0
 */
public class ExceptionResource {

	private Properties errors;
	
	public ExceptionResource(Properties errors){
		this.errors = errors;
	}
	
	public String getMessage(String code){
		if(errors == null) return null;
			
		return errors.getProperty(code);
	}

	public String toString() {
		return "ExceptionResource [errors=" + errors + "]";
	}
	
}
